package com.yunxi.model.otd;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.Version;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.util.StringUtils;

/**
 * <p>
 * 生产计划变更申请
 * </p>
 *
 * @author XUQI
 * @since 2019-05-25
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("pms_otd_plan_change_apply")
@ApiModel(value = "OtdPlanChangeApply对象", description = "生产计划变更申请")
public class OtdPlanChangeApply implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "变更申请ID")
    @TableId(value = "PLAN_CHANGE_APPLY_ID", type = IdType.UUID)
    private String planChangeApplyId;

    @ApiModelProperty(value = "变更申请CODE")
    @TableField("PLAN_CHANGE_APPLY_CODE")
    private String planChangeApplyCode;

    @ApiModelProperty(value = "生产计划号")
    @TableField("PLAN_NO")
    private String planNo;

    @ApiModelProperty(value = "OLD产品编号")
    @TableField("OLD_PRODUCT_CODE")
    private String oldProductCode;

    @ApiModelProperty(value = "NEW产品编号")
    @TableField("NEW_PRODUCT_CODE")
    private String newProductCode;

    @ApiModelProperty(value = "原选装包编码")
    @TableField("OLD_CUSTOM_PACK_CODE")
    private String oldCustomPackCode;

    @ApiModelProperty(value = "选装包编码")
    @TableField("NEW_CUSTOM_PACK_CODE")
    private String newCustomPackCode;

    @TableField("STATE")
    @ApiModelProperty(value = "状态 1：未释放 2 生产待审核  3 驳回  4通过")
    private String state;

    @ApiModelProperty(value = "变更类型：U：update更新 D:del 删除")
    @TableField("CHANGE_TYPE")
    private String changeType;

    @ApiModelProperty(value = "驳回原因")
    @TableField("REJECT_REASON")
    private String rejectReason;

    @ApiModelProperty(value = "创建人")
    @TableField(value = "CREATE_BY", fill = FieldFill.INSERT)
    private String createBy;

    @ApiModelProperty(value = "创建时间")
    @TableField(value = "CREATE_DATE", fill = FieldFill.INSERT)
    private Date createDate;

    @ApiModelProperty(value = "最后修改人")
    @TableField(value = "UPDATE_BY", fill = FieldFill.INSERT_UPDATE)
    private String updateBy;

    @ApiModelProperty(value = "最后修改时间")
    @TableField(value = "UPDATE_DATE", fill = FieldFill.INSERT_UPDATE)
    private Date updateDate;

    @Version
    @ApiModelProperty(value = "版本号")
    @TableField("VERSION")
    private Integer version;

    @ApiModelProperty(value = "接口传送标识")
    @TableField("IS_SEND")
    private Integer isSend;

    @ApiModelProperty(value = "是否删除")
    @TableField("IS_DEL")
    private Integer isDel;

    public void setOldCustomPackCode(String oldCustomPackCode) {
        this.oldCustomPackCode = StringUtils.isEmpty(oldCustomPackCode) ? null : oldCustomPackCode;
    }

    public void setNewCustomPackCode(String newCustomPackCode) {
        this.newCustomPackCode = StringUtils.isEmpty(newCustomPackCode) ? null : newCustomPackCode;
    }
}
